﻿<local:DocumentBase x:Class="WPFExcelReport.JLTVKWZ"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    Loaded="Window_Loaded"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    Height="700" Width="1024" 
                    Title="JLTVKWZ"  
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:MaskPrice  x:Key="dprice"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000  x:Key="d10000"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetQP" />
        <CollectionViewSource   x:Key="vwKUNDADR" Source="{Binding Path=KUNDADR,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwKDSTAMM" Source="{Binding Path=KDSTAMM,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVKKOPF" Source="{Binding Path=VKKOPF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVKPOS" Source="{Binding Path=VKPOS,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVVTLIEF" Source="{Binding Path=VVTLIEF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVVLIEF" Source="{Binding Path=VVLIEF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwWBBST" Source="{Binding Path=WBBST,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVVPACK" Source="{Binding Path=VVPACK,Source={StaticResource SetData}}" />
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="200" />
            <RowDefinition Height="500" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.ColumnSpan="2"  >
            <WrapPanel Name="ZoneOrder">
                <TextBlock FontSize="18"  Height="Auto" Width="Auto">订单号:</TextBlock>
                <TextBox   FontSize="18" Name="txtVKPAUFKRS"  Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="White" />
                <TextBox  FontSize="18" Name="txtVKPAUFLFD"  Width="80" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="White" />
                <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="btnQuery" Click="btnQuery_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/Search.png" />
                    </Button.Background>
                </Button>
                <TextBox Name="txtLang">CN</TextBox>
                <Button   Height="30" Margin="20,0,0,0"  Name="btnPreview" Width="30" Click="btnPreview_Click">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/excel_icon.jpg" />
                    </Button.Background>
                </Button>
                <Button   Height="30" Margin="20,0,0,0"  Name="btnPrint" Width="30" Click="btnPrint_Click">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/Print.png" />
                    </Button.Background>
                </Button>
            </WrapPanel>
        </StackPanel>
        <FlowDocumentScrollViewer  Grid.Row="1" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"  Name="FlowDocViewer" >
            <FlowDocument>
                <Paragraph>                    
                    <StackPanel   >
                        <DataGrid 
                            CanUserReorderColumns="True"  
                            CanUserResizeRows="True" CanUserSortColumns="True"
                            AutoGenerateColumns="False"   
                            EnableRowVirtualization="True"  
                            RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                            IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                            ItemsSource="{Binding Source={StaticResource ResourceKey=vwVVTLIEF}}" 
                            Margin="0,2,0,0" 
                            x:Name="dlgVKPOS" >
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="发货单" Binding="{Binding VVTLIEFSCH,Converter={StaticResource ResourceKey=pnum}}" Width="80"/>
                                <DataGridTextColumn Header="" Binding="{Binding VVTAUFKRS}" Width="40"/>
                                <DataGridTextColumn Header="销售单" Binding="{Binding VVTAUFLFD}" Width="80"/>
                                <DataGridTextColumn Header="" Binding="{Binding VVTAUFPOS}" Width="40"/>
                                <DataGridTextColumn Header="批次" Binding="{Binding VVTTEILNR,Converter={StaticResource ResourceKey=pnum}}" Width="80"/> 
                                <DataGridTextColumn Header="留位" Binding="{Binding VVTMTR,Converter={StaticResource ResourceKey=d100}}" Width="120"/>
                                <DataGridTextColumn Header="单位" Binding="{Binding VVTME}"/>
                            </DataGrid.Columns>
                        </DataGrid  >
                    </StackPanel>
                </Paragraph>
                <Paragraph>
                    <DataGrid  
                AutoGenerateColumns="False" 
                HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                               ItemsSource="{Binding Source={StaticResource ResourceKey=vwWBBST}}" 
                               Margin="0,0,0,0" 
                               x:Name="listWBBST" Height="Auto">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="序号" Binding="{Binding CODE}"/>
                            <DataGridTextColumn Header="缸号" Binding="{Binding WBBDPART}"/>
                            <DataGridTextColumn Header="色级" Binding="{Binding WBBTAX}"/>
                            <DataGridTextColumn Header="板号" Binding="{Binding WBBRWLFD}"/>
                            <DataGridTextColumn Header="布卷号" Binding="{Binding WBBSTKNR}"/>
                            <DataGridTextColumn Header="品种" Binding="{Binding WBBART}"/>
                            <DataGridTextColumn Header="变量" Binding="{Binding WBBVAR}"/>
                            <DataGridTextColumn Header="颜色" Binding="{Binding WBBFARBE}"/>
                            <DataGridTextColumn Header="后整理方式" Binding="{Binding WBBBESCHICH}"/>
                            <DataGridTextColumn Header="数量(码)" Binding="{Binding WBBISTKLG}"/>
                            <DataGridTextColumn Header="重量(KG)" Binding="{Binding WBBSGEW}"/>
                        </DataGrid.Columns>
                    </DataGrid  >
                </Paragraph>
            </FlowDocument>
        </FlowDocumentScrollViewer>
    </Grid>
</local:DocumentBase>